package lab02.test29;

public class Test29 {
    public static void main(String[] args) {

        int[] numbers = new int[5];
        numbers[0] = 12;
        numbers[1] = 16;
        numbers[2] = 14;
        numbers[3] = 19;
        numbers[4] = 20;

        try {
            //有可能出错的代码
            System.out.println(numbers[5]);
        } catch (ArrayIndexOutOfBoundsException e) {
            //1.出的什么错误
            //2.出错了怎么处理
            System.out.println("数组下标越界！！！");
        } finally {

            //不管如何都要执行的代码
            System.out.println("无论怎样都会运行的代码！！！");
        }
    }
}
